package com.wl.mall.web.page.controller;

import com.wl.mall.util.common.entity.RespResult;
import com.wl.mall.web.page.service.SeckillPageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/page")
public class SeckillPageController {

    @Autowired
    private SeckillPageService seckillPageService;

    /***
     * 秒杀详情页生成
     * @param id
     * @return
     */
    @GetMapping(value = "/seckill/goods/{id}")
    public RespResult page(@PathVariable(value = "id")String id) throws Exception {
        //生成静态页
        seckillPageService.html(id);
        return RespResult.ok();
    }
}